﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Windows;
using System.Windows.Input;
// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using BrainTechLLC;
using BrainTechLLC.FilterExtensions;
using ImageAppDataModels;
using ImageAppViewModels;


namespace WpfImageDuplicates
{                
    public partial class WantCompareMultipleInNewWindow : RoutedCommand, ICommand
    {
        public void Execute(ObservableCollection<FileImageViewModel> list)
        {
            Window1.MainWindow._CompareMultiple.Handler.OpenAskWindow(list, string.Empty);
        }

        public bool Execute(SimilarityGrouping group)
        {
            ObservableCollection<FileImageViewModel> list = new ObservableCollection<FileImageViewModel>();

            for (int n = 0; n < group.Similar.Count; n++)
            {
                var other = group.Similar[n];

                if (!other.FileImage.Deleted)
                {
                    list.Add(other);
                }
            }

            if (list.Count <= 1)
                return true;

            Window1.MainWindow._CompareMultiple.Handler.OpenAskWindow(list, group.GroupName);

            return false;
        }
    }
}
